const Home = () => import('./Home')
const Cart = () => import('./Cart')
const Detail = () => import('./Detail')
const Mine = () => import('./Mine')
const Mall = () => import('./Mall')
const Setting = () => import('./Setting')
const First = () => import('./sceondpage/first.vue')
const Second = () => import('./sceondpage/second.vue')
const Third = () => import('./sceondpage/third.vue')
const Four = () => import('./sceondpage/four.vue')
const Five = () => import('./sceondpage/five.vue')
const Guang = () => import('./Guang')
import Bottom from '../components/bottom.vue'

const routes = [{
  path:'/',
  redirect:'/home'
},  
  {
  path: '/home',
  name: 'home',
  title: '首页',
  meta:{title: '首页'},
  nav: true,
  components: {
    default:Home,
    bottom:Bottom
  },
  icon:'&#xe604;'
},{
  path: '/mall',
  name: 'mall',
  title: '分类',
  meta:{title: '分类'},
  nav: true,
  components: {
    default:Mall,
    bottom:Bottom
  },
  icon:'&#xe605;'  
}, 
{
  path: '/guang',
  //name: 'guang',
  title: '逛',
  meta:{title: '逛'},
  nav: true, 
  components: {
    default:Guang,
    bottom:Bottom
  },
  icon:'&#xe600;',
  children: [
    {
      path:'/',
      redirect:'/guang/first'
    },
    {
      path: 'first',
      name: 'first',
      component: First,
      props: true,
      meta:{title: '逛'}
    },
    {
      path: 'second',
      name: 'second',
      component: Second,
      props: true,
      meta:{title: '逛'}
    },
    {
      path: 'third',
      name: 'third',
      component: Third,
      props: true,
      meta:{title: '逛'}
    },
    {
      path: 'four',
      name: 'four',
      component: Four,
      props: true,
      meta:{title: '逛'}
    },
    {
      path: 'five',
      name: 'five',
      component: Five,
      props: true,
      meta:{title: '逛'}
    } 
  ]
},{
  path: '/cart',
  name: 'cart',
  title: '购物车',
  nav: true,
  meta:{
  isrequired:true,
  title: '购物车'
  }, 
  components: {
    default:Cart,
    bottom:Bottom
  },
  icon:'&#xe603;'
},{
  path: '/detail',
  name: 'detail',
  title: '详情',
  meta:{title: '详情'},
  nav: false,
  component: Detail,
  icon:'&#xe604;',
  props:true
}, {
  path: '/mine',
  name: 'mine',
  title: '我的',
  meta:{title: '我的'},
  nav: true,
  components: {
    default:Mine,
    bottom:Bottom
  },
  icon:'&#xe606;'
}, {
  path: '/setting',
  name: 'setting',
  title: '设置',
  nav: false,
  component: Setting,
  icon:'&#xe604;'
}]

export const secondroutes=routes[3].children.filter(item=>item.props===true)

export default routes
